<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>5.z-index</title>
    <style>
        .box1 {
            width: 300px;
            height: 300px;
            background-color: aqua;
            /* 设置层级 */
            z-index: 999;
            /* 触发机制 */
            position: absolute;
            /* position: fixed; */
        }

        .box2 {
            width: 400px;
            height: 400px;
            background-color: blueviolet;
            /* 脱离文档里(漂浮起来) */
            position: absolute;
        }
    </style>
</head>

<body>
    <div class="box1">小</div>
    <div class="box2">大</div>
</body>

</html>